import request from '@/utils/request/index.js'
export default {

	/**
	 * 获取需求数量
	 */
	getDemandCount(data){
		return request.request({
			url:"/h5/nocdemand/getDemandCount",
			data: {userId: data}
		})
	},

	/**
	 * 获取我的收藏
	 */
	getCollectionAxios(data){
		return request.request({
			url:"/h5/nocyxcollect/count",
			data: {userId: data}
		})
	},

	/**
	 * 获取被收藏量,1.产品收藏  2.需求收藏 3.关注 4.点赞
	 */
	getCollectMineByType(userId, types, productId, demandId) {
		return request.request({
			url:"/h5/nocyxcollect/collectMineByType",
			data: {
				userId: userId,
				types: types,
				productId: productId || undefined,
				demandId: demandId || undefined
			}
		});
	},

	/**
	 * 获取关注人和点赞3.关注人 4.点赞
	 * @param type
	 * @param userId
	 * @param page
	 * @returns {*}
	 */
	getCollectionCountByTypeAxios(type, userId, page = 1) {
		return request.request({
			url: "/h5/nocyxcollect/countByType",
			data: {
				userId: userId,
				type: type
			}
		});
	},

	/**
	 * 询价单
	 * @param userId
	 * @returns {*}
	 */
	getInquiryCount(userId) {
		return request.request({
			url: "/h5/nocinquiry/getInquiryCount",
			data: {
				userId: userId
			}
		});
	},


	getInquiryList(userId) {
		return request.request({
			url: '/h5/nocmsggroup/footerMsgCount',
			data: {
				id: userId
			}
		});
	},

	getUnread(userId) {
		return request.request({
			url: '/h5/nocinquiry/unread/' + userId,
			method: 'get'
		});
	}




}
